package cn.fyg.service.finance.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import cn.fyg.common.base.retv.Retv;
import cn.fyg.service.finance.domain.salary.ProjectDto;
import cn.fyg.service.finance.domain.salary.SalaryDto;
import cn.fyg.service.finance.domain.salary.SalaryService;


@RestController
@RequestMapping("salary")
public class SalaryController {
	@Autowired
	private SalaryService salaryService;
	
	@PostMapping(value = "/")
	public Retv<List<ProjectDto>> getAllProjects(@RequestParam("accountnumber") String accountnumber) {
		return this.salaryService.getAllProject(accountnumber);
	}
	
	@PostMapping(value = "/pjdetail")
	public Retv<SalaryDto> getSalary(@RequestParam("accountnumber") String accountnumber, @RequestParam("projectnumber") String projectnumber){

		return this.salaryService.getSalary(accountnumber, projectnumber);
	}
}
